package priority;

public class MyPriorityMain {
    public static void main(String[] args) {
        Thread t = new Thread(new MyPriorityThread());
        Thread t2 = new Thread(new MyPriorityThread());
        /* Runnable r=new MyPriorityThread();
        Thread t=new Thread(r);
        Thread t2=new Thread(r);*/
        t.setName("低线程1 ");
        t2.setName("高线程2 ");
        //不设置优先级之前，一直是t1 t2 t1 t2
        //设置t2优先级
        t2.setPriority(Thread.MAX_PRIORITY);
        t.setPriority(Thread.MIN_PRIORITY);
        t.start();
        t2.start();
    }
}
